< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03060300.xhp

(section: imp) (bookmark: bm_id3156024)
Imp operator (logical)

Imp論理演算子

Imp Operator [Runtime]
Imp 演算子 [実行時](hd_id3156024.1)

Performs a logical implication on two expressions.
2 つの表式間の論理包含演算を行います。(par_id3148947.2)

(/section: imp)

Syntax:
構文:(hd_id3148664.3)

Result = Expression1 Imp Expression2
Result = Expression1 Imp Expression2(par_id3149656.4)

Parameters:
パラメータ:(hd_id3151212.5)

Result: Any numeric variable that contains the result of the implication.
Result:演算結果を格納する数値変数。(par_id3154910.6)

Expression1, Expression2: Any expressions that you want to evaluate with the Imp operator.
Expression1, Expression2: Imp 演算子に評価させる表式。(par_id3156281.7)

If you use the Imp operator in Boolean expressions, False is only returned if the first expression evaluates to True and the second expression to False.
ブール型の表式に対して Imp 演算を行う場合、1 番目の表式が True と評価され、2 番目の表式が False と評価される場合、結果が False となります。(par_id3150440.8)

If you use the Imp operator in bit expressions, a bit is deleted from the result if the corresponding bit is set in the first expression and the corresponding bit is deleted in the second expression.
ビット型の表式に対して Imp 演算を行う場合、1 番目のビットが 1 であり、2 番目のビットが 0 である場合、演算結果のビットが 0 となります。(par_id3163710.9)

Example:
例:(hd_id3147318.10)

Sub ExampleImp
Sub ExampleImp(par_id3155854.11)

Dim A as Variant, B as Variant, C as Variant, D as Variant
Dim A as Variant, B as Variant, C as Variant, D as Variant(par_id3145272.12)

Dim vOut as Variant
Dim vOut as Variant(par_id3159156.13)

A = 10: B = 8: C = 6: D = Null
A = 10: B = 8: C = 6: D = Null(par_id3151116.14)

vOut = A > B Imp B > C REM returns -1
vOut = A > B Imp B > C REM 戻り値は -1(par_id3145750.15)

vOut = B > A Imp B > C REM returns -1
vOut = B > A Imp B > C REM returns -1(par_id3156441.16)

vOut = A > B Imp B > D REM returns 0
vOut = A > B Imp B > D REM returns 0(par_id3152596.17)

vOut = (B > D Imp B > A) REM returns -1
vOut = (B > D Imp B > A) REM returns -1(par_id3154942.18)

vOut = B Imp A REM returns -1
vOut = B Imp A REM returns -1(par_id3154492.19)

End Sub
End Sub(par_id3147394.20)


< Prev / Next >